]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionSystem: Only add to extensionOrder array if enabling worked
authorJonas Dreßler <verdre@v0yd.nl>
Mon, 9 Sep 2019 14:07:32 +0000 (16:07 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Thu, 12 Sep 2019 10:24:49 +0000 (10:24 +0000)
Only push uuids of newly enabled extensions to the `_extensionOrder`
array if enabling them was successful.

Otherwise, since `_callExtensionDisable()` doesn't remove uuids that
weren't successfully enabled from the array, those extensions get added
to the array multiple times when they're disabled and enabled.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/96

js/ui/extensionSystem.js

index d149568101934a68a52ff7c201d667c8b75dfbfc..714537b5d2938a501ee3d17955926ee9786d5153 100644 (file)
@@ -111,8 +111,6 @@ var ExtensionManager = class {
         if (extension.state != ExtensionState.DISABLED)
             return;
 
-        this._extensionOrder.push(uuid);
-
         let stylesheetNames = [`${global.session_mode}.css`, 'stylesheet.css'];
         let theme = St.ThemeContext.get_for_stage(global.stage).get_theme();
         for (let i = 0; i < stylesheetNames.length; i++) {
@@ -132,6 +130,7 @@ var ExtensionManager = class {
         try {
             extension.stateObj.enable();
             extension.state = ExtensionState.ENABLED;
+            this._extensionOrder.push(uuid);
             this.emit('extension-state-changed', extension);
         } catch (e) {
             if (extension.stylesheet) {